#include "xege.h"
#include <chrono>
#include <thread>

// using namespace std::chrono::literals;
double seconds = 0;
std::chrono::time_point<std::chrono::steady_clock> last = std::chrono::steady_clock::now ();
std::chrono::duration<double> d;
int delay_fps (double fps) {
	double dt = 1.0/fps;
	d = std::chrono::steady_clock::now () - last;
	dt = dt-d.count ();
	if (dt > 0) {
		// std::this_thread::sleep_for (std::chrono::duration(1000ms*dt));
		SDL_Delay (1000 * dt);
	}
	last = std::chrono::steady_clock::now ();
}
